package com.zj.ssm.controller;

import com.zj.ssm.pojo.domain.query.NewsOpinionsQuery;
import com.zj.ssm.pojo.domain.vo.OpinionVO;
import com.zj.ssm.result.AjaxResult;
import com.zj.ssm.service.NewsOpinionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author wxr
 * @version 1.0
 * @date 2022/2/14 21:07
 */
@RestController
@RequestMapping("opinion")
public class NewsOpinionController {
    @Autowired
    private NewsOpinionService newsOpinionService;

    @RequestMapping("opinions")
    public AjaxResult opinions(NewsOpinionsQuery newsOpinions){
        return newsOpinionService.opinions(newsOpinions);
    }

    @RequestMapping("delete/{id}")
    public AjaxResult delete(@PathVariable("id") Integer id){
        return newsOpinionService.deleteNewsOpinion(id);

    }

    @RequestMapping("send")
    public AjaxResult send(OpinionVO opinionVO){
        return newsOpinionService.send(opinionVO);
    }
}
